<div class="admin-container">
    <!-- 侧边栏 -->
    <div class="sidebar">
        <div class="logo">后台管理系统</div>
        <nav class="nav">
            <ul>
                <li>
                    <a href="/admin/index" 
                       hx-get="/admin/index/content" 
                       hx-target="#main-content"
                       hx-swap="innerHTML">
                        <i class="icon-home"></i>
                        首页
                    </a>
                </li>
                <li>
                    <a href="/admin/user" 
                       hx-get="/admin/user/list" 
                       hx-target="#main-content"
                       hx-swap="innerHTML">
                        <i class="icon-user"></i>
                        用户管理
                    </a>
                </li>
                <li>
                    <a href="/admin/role" 
                       hx-get="/admin/role/list" 
                       hx-target="#main-content"
                       hx-swap="innerHTML">
                        <i class="icon-role"></i>
                        角色管理
                    </a>
                </li>
                <li>
                    <a href="/admin/menu" 
                       hx-get="/admin/menu/list" 
                       hx-target="#main-content"
                       hx-swap="innerHTML">
                        <i class="icon-menu"></i>
                        菜单管理
                    </a>
                </li>
            </ul>
        </nav>
    </div>

    <!-- 主内容区 -->
    <div class="main">
        <!-- 顶部栏 -->
        <div class="header">
            <div class="user-info">
                <div class="avatar">
                    <img src="/static/avatar.png" alt="用户头像">
                </div>
                <div class="dropdown">
                    <span class="username">管理员</span>
                    <div class="dropdown-content">
                        <a href="/admin/profile">个人中心</a>
                        <a href="/admin/logout">退出登录</a>
                    </div>
                </div>
            </div>
        </div>

        <!-- 内容区 -->
        <div id="main-content" 
             hx-get="/admin/index/content" 
             hx-trigger="load">
            加载中...
        </div>
    </div>
</div>

<style>
    .admin-container {
        display: flex;
        min-height: 100vh;
    }

    .sidebar {
        width: 240px;
        background-color: #673ab7;
        color: white;
        padding: 1rem;
    }

    .logo {
        font-size: 1.25rem;
        font-weight: bold;
        margin-bottom: 2rem;
        text-align: center;
    }

    .nav ul {
        list-style: none;
        padding: 0;
    }

    .nav li {
        margin-bottom: 0.5rem;
    }

    .nav a {
        display: flex;
        align-items: center;
        color: white;
        text-decoration: none;
        padding: 0.75rem;
        border-radius: 4px;
        transition: background-color 0.3s;
    }

    .nav a:hover {
        background-color: rgba(255,255,255,0.1);
    }

    .nav i {
        margin-right: 0.5rem;
    }

    .main {
        flex: 1;
        background-color: #f5f5f5;
    }

    .header {
        background-color: white;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .user-info {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .avatar img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        margin-right: 0.5rem;
    }

    .dropdown {
        position: relative;
        cursor: pointer;
    }

    .dropdown-content {
        display: none;
        position: absolute;
        right: 0;
        background-color: white;
        min-width: 120px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border-radius: 4px;
        z-index: 1;
    }

    .dropdown-content a {
        color: #333;
        padding: 0.5rem 1rem;
        text-decoration: none;
        display: block;
    }

    .dropdown-content a:hover {
        background-color: #f5f5f5;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }
</style>

<script>
    // 初始化页面内容
    document.addEventListener('DOMContentLoaded', function() {
        htmx.trigger('#main-content', 'load');
    });
</script>
